
	cd " "	
		
	use census_pool, clear
	gen one = 1
	drop if ybirth<1950	
	keep if age>=25 & age<=60
	
	bys uid2000 ybirth: egen count = total(one)
	
	bys uid2000 ybirth: egen yedu_q1 = mean(yedu) if qbirth==1	
	bys uid2000 ybirth: egen yedu_q2 = mean(yedu) if qbirth==2	
	bys uid2000 ybirth: egen yedu_q3 = mean(yedu) if qbirth==3	
	bys uid2000 ybirth: egen yedu_q4 = mean(yedu) if qbirth==4	
	
	bys uid2000 ybirth: egen yedu_q1_m = mean(yedu) if qbirth==1 & male==1
	bys uid2000 ybirth: egen yedu_q2_m = mean(yedu) if qbirth==2 & male==1
	bys uid2000 ybirth: egen yedu_q3_m = mean(yedu) if qbirth==3 & male==1
	bys uid2000 ybirth: egen yedu_q4_m = mean(yedu) if qbirth==4 & male==1
	
	bys uid2000 ybirth: egen yedu_q1_f = mean(yedu) if qbirth==1 & male==0
	bys uid2000 ybirth: egen yedu_q2_f = mean(yedu) if qbirth==2 & male==0
	bys uid2000 ybirth: egen yedu_q3_f = mean(yedu) if qbirth==3 & male==0
	bys uid2000 ybirth: egen yedu_q4_f = mean(yedu) if qbirth==4 & male==0
	
	keep uid2000 ybirth count yedu_q*
	duplicates drop	
	
	foreach var of varlist yedu_q*  {
		bys uid2000 ybirth: egen min_`var' = min(`var')
		replace `var' = min_`var'
		drop min_`var'
	}

	duplicates drop
	
	gen yedu_4_2   = yedu_q4   - yedu_q2
	gen yedu_4_1   = yedu_q4   - yedu_q1
	gen yedu_4_2_m = yedu_q4_m - yedu_q2_m
	gen yedu_4_1_m = yedu_q4_m - yedu_q1_m
	gen yedu_4_2_f = yedu_q4_f - yedu_q2_f
	gen yedu_4_1_f = yedu_q4_f - yedu_q1_f
	gen yedu_4_1_diff = yedu_4_1_f - yedu_4_1_m
	gen yedu_4_2_diff = yedu_4_2_f - yedu_4_2_m
	
	
	rename ybirth year
	merge 1:1 uid2000 year using Weather_uid2000 
	drop if _merge!=3
	drop _merge
	
	gen prov = int(uid2000/10000)	
	egen prov_year = group(prov year)	
		
	replace degree1 = degree1 / 100	
	bys uid2000: egen m_degree1 = mean(degree1)
	gen dm_degree1 = degree1 - m_degree1	
	summ dm_degree1

	xtset uid2000 year
	
	// Table A18
	preserve
		drop if year>=1959 & year<=1961	
		reg  degree1 L.degree1              ,  cluster(uid2000) 		
		reg  degree1 L.degree1 L2.degree1   ,  cluster(uid2000)
		reghdfe degree1 L.degree1           ,  absorb(uid2000) cluster(uid2000) 
		reghdfe degree1 L.degree1 L2.degree1,  absorb(uid2000) cluster(uid2000) 
	restore

	drop if yedu_4_1==. | yedu_4_1_m==. | yedu_4_1_f==.
	
	merge m:1 uid2000 using urban1990
	drop _merge
	
	gen post80 = (year>=1980)
 	gen rural_post80 = urban1990_low50*post80
	gen post71 = (year>=1971)
 	gen rural_post71 = urban1990_low50*post71
	gen post74 = (year>=1974)
 	gen rural_post74 = urban1990_low50*post74
	
	xtset uid2000 year
	drop if year>=1959 & year<=1961
	drop if year<=1956
	gen lag_degree1 = L.degree1
	
	drop if yedu_4_2_f==. | yedu_4_2_m==. | yedu_4_2==.		
	drop if lag_degree1==.	
	bys uid2000: gen n_county = _N
	drop if n_county==1
	
	// Table A17
	sum lag_degree1 yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff  
	sum lag_degree1 yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff if urban1990_high50==1 	
	sum lag_degree1 yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff if urban1990_low50==1 	
	
	// Table 8: Panel A
	reghdfe yedu_4_2  lag_degree1 [w=count] , absorb(uid2000 year) cluster(uid2000) 		
	reghdfe yedu_4_2_f lag_degree1 [w=count], absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m lag_degree1 [w=count], absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff lag_degree1 [w=count] , absorb(uid2000 year) cluster(uid2000) 
	
	// Table 8: Panel B
	reghdfe yedu_4_2  lag_degree1 [w=count] if urban1990_high50==1, absorb(uid2000 year) cluster(uid2000) 		
	reghdfe yedu_4_2_f lag_degree1 [w=count] if urban1990_high50==1, absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m lag_degree1 [w=count] if urban1990_high50==1, absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff lag_degree1 [w=count] if urban1990_high50==1, absorb(uid2000 year) cluster(uid2000) 

	// Table 8: Panel C
	reghdfe yedu_4_2  lag_degree1 [w=count] if urban1990_low50==1, absorb(uid2000 year) cluster(uid2000) 		
	reghdfe yedu_4_2_f lag_degree1 [w=count] if urban1990_low50==1, absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m lag_degree1 [w=count] if urban1990_low50==1, absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff lag_degree1 [w=count] if urban1990_low50==1, absorb(uid2000 year) cluster(uid2000) 
	
	// Table 9
	xtset uid2000 year
	set more off
	preserve 	
	keep if year>=1975 & year<=1984		
	sum yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff 		
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 

	
********************************************************************

	
	merge 1:1 uid2000 year using Weather_uid2000_weight3
	drop if _merge==2
	drop _merge
	
	replace wdegree1 = wdegree1 / 100
	
	xtset uid2000 year
	
	// Table A19
	reghdfe yedu_4_2  L.wdegree1 [w=count] if lag_degree1!=. , absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_f L.wdegree1 [w=count]  if lag_degree1!=., absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m L.wdegree1 [w=count]  if lag_degree1!=., absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff L.wdegree1 [w=count]  if lag_degree1!=., absorb(uid2000 year) cluster(uid2000) 
		
	reghdfe yedu_4_2  lag_degree1 [w=count] if count>=30 , absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_f lag_degree1 [w=count] if count>=30 , absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m lag_degree1 [w=count] if count>=30 , absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff lag_degree1 [w=count] if count>=30 , absorb(uid2000 year) cluster(uid2000) 
	
	reghdfe yedu_4_2  lag_degree1 [w=count] if prov!=11 & prov!=12 & prov!=31, absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_f lag_degree1 [w=count] if prov!=11 & prov!=12 & prov!=31 , absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m lag_degree1 [w=count] if prov!=11 & prov!=12 & prov!=31 , absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff lag_degree1 [w=count] if prov!=11 & prov!=12 & prov!=31 , absorb(uid2000 year) cluster(uid2000) 
	
	reghdfe yedu_4_2  lag_degree1 [w=count] if prov!=15 & prov!=54 & prov<=61, absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_f lag_degree1 [w=count] if prov!=15 & prov!=54 & prov<=61 , absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m lag_degree1 [w=count] if prov!=15 & prov!=54 & prov<=61 , absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff lag_degree1 [w=count] if prov!=15 & prov!=54 & prov<=61 , absorb(uid2000 year) cluster(uid2000) 
		
	reghdfe yedu_4_1  lag_degree1 [w=count], absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_1_f lag_degree1 [w=count], absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_1_m lag_degree1 [w=count], absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_1_diff lag_degree1 [w=count], absorb(uid2000 year) cluster(uid2000) 
	
********************************************************************
	
	// Table A20
	xtset uid2000 year
	preserve 	
	keep if year>=1969 & year<=1978	
	sum yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff 		
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post74  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post74   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post74  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post74   [w=count], absorb( uid2000  prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post74  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post74   [w=count] , absorb( uid2000  prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post74  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post74  [w=count] , absorb( uid2000  prov#year ) cluster(uid2000) 
		
	xtset uid2000 year
	preserve 	
	keep if year>=1970 & year<=1989		
	sum yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff 		
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	
	xtset uid2000 year
	preserve 	
	keep if year>=1975 & year<=1984
	sum yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff 		
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count] , absorb(uid2000 year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count], absorb(uid2000 year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80   [w=count] , absorb(uid2000  year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80  [w=count] , absorb(uid2000 year ) cluster(uid2000) 
	

********************************************************************


	merge m:1 prov using prov_ocp_year
	drop _merge
	gen ocp = year>=ocp_year
	gen llf = year>=llf_year	
	replace ocp=0 if prov==54
	
	// Table D6: Panel A	
	preserve 	
	keep if year>=1975 & year<=1984
	sum yedu_4_2 yedu_4_2_f yedu_4_2_m yedu_4_2_diff 	
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	restore 
	
	// Table D6: Panel B	
	preserve 	
	keep if year>=1975 & year<=1984
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp##c.urban1990_low50  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp##c.urban1990_low50   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp##c.urban1990_low50   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.ocp##c.urban1990_low50  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	restore 
		
		
	merge m:1 uid2000 using uid2000_reforms
	gen hrs = year>=family_year
	gen ocp_cty = year>=ocp_financial
	drop _merge
	
	// Table D7
	xtset uid2000 year
	preserve
		keep if year>=1971 & year<=1988
		summ yedu_4_1 yedu_4_1_m yedu_4_1_f yedu_4_1_diff 	
		keep if family_year!=.
		replace degree1 = degree1-24.38
		
		reghdfe yedu_4_2    cL.degree1##c.urban1990_low50##cL.hrs     [w=count] , absorb(uid2000  prov#year ) cluster(uid2000) 
		reghdfe yedu_4_2_m cL.degree1##c.urban1990_low50##cL.hrs     [w=count], absorb(uid2000 prov#year)  cluster(uid2000) 
		reghdfe yedu_4_2_f cL.degree1##c.urban1990_low50##cL.hrs    [w=count] , absorb(uid2000 prov#year) cluster(uid2000) 
		reghdfe yedu_4_2_diff cL.degree1##c.urban1990_low50##cL.hrs      [w=count] , absorb(uid2000  prov#year) cluster(uid2000) 
			
		reghdfe yedu_4_2    cL.degree1##c.urban1990_low50##cL.hrs cL.degree1##c.ocp_cty    [w=count] , absorb(uid2000  prov#year ) cluster(uid2000) 
		reghdfe yedu_4_2_m cL.degree1##c.urban1990_low50##cL.hrs cL.degree1##c.ocp_cty    [w=count], absorb(uid2000 prov#year)  cluster(uid2000) 
		reghdfe yedu_4_2_f cL.degree1##c.urban1990_low50##cL.hrs cL.degree1##c.ocp_cty   [w=count] , absorb(uid2000 prov#year) cluster(uid2000) 
		reghdfe yedu_4_2_diff cL.degree1##c.urban1990_low50##cL.hrs  cL.degree1##c.ocp_cty    [w=count] , absorb(uid2000  prov#year) cluster(uid2000) 

		reghdfe yedu_4_2    cL.degree1##c.urban1990_low50##cL.hrs cL.degree1##c.urban1990_low50##c.ocp_cty    [w=count] , absorb(uid2000  prov#year ) cluster(uid2000) 
		reghdfe yedu_4_2_m cL.degree1##c.urban1990_low50##cL.hrs cL.degree1##c.urban1990_low50##c.ocp_cty    [w=count], absorb(uid2000 prov#year)  cluster(uid2000) 
		reghdfe yedu_4_2_f cL.degree1##c.urban1990_low50##cL.hrs cL.degree1##c.urban1990_low50##c.ocp_cty   [w=count] , absorb(uid2000 prov#year) cluster(uid2000) 
		reghdfe yedu_4_2_diff cL.degree1##c.urban1990_low50##cL.hrs  cL.degree1##c.urban1990_low50##c.ocp_cty    [w=count] , absorb(uid2000  prov#year) cluster(uid2000) 
	restore	
		
	rename prov provbirth
	rename year ybirth
	merge m:1 provbirth using prov_cel
	drop if _merge==2
	drop _merge
	
	gen age_cel = cel_year - ybirth
		
	gen cel_exposed = 0
	replace cel_exposed = (16 - age_cel)/10
	replace cel_exposed = 0 if age_cel>=16
	replace cel_exposed = 1 if age_cel<=6
	rename provbirth prov
	rename ybirth year 
	
	gen cel_exposed_yes = cel_exposed>0
	
	// Table D8
	preserve 	
	keep if year>=1975 & year<=1984
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	restore
	
	preserve 	
	keep if year>=1975 & year<=1984
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes##c.urban1990_low50  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes##c.urban1990_low50   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes##c.urban1990_low50   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.cel_exposed_yes##c.urban1990_low50  [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	restore
	
	
	merge m:1 prov year using prov_jcol_15
	drop if _merge==2
	drop _merge
	
	// Table D9
	set more off
	preserve 	
	keep if year>=1975 & year<=1984
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	
	set more off
	preserve 	
	keep if year>=1975 & year<=1984
	reghdfe yedu_4_2   c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college##c.urban1990_low50   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 		
	reghdfe yedu_4_2_m c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college##c.urban1990_low50   [w=count], absorb( uid2000 prov#year )  cluster(uid2000) 
	reghdfe yedu_4_2_f c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college##c.urban1990_low50   [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	reghdfe yedu_4_2_diff c.lag_degree1##c.rural_post80  c.lag_degree1#c.urban1990_low50  c.lag_degree1#c.post80 c.lag_degree1##c.college##c.urban1990_low50 [w=count] , absorb( uid2000 prov#year ) cluster(uid2000) 
	
	
	// Table G3
	* measles 54 63 65
	* bad     11 12
	* malaria 44 53
	* dengue  35 45
	* brucellosis 21 22 23 14 15 62 64
	* tuberculosis 44 50 54 63 65
	set more off
	preserve
 	// drop if prov==54 | prov==63 | prov==65
 	// drop if prov==11 | prov==12  
 	// drop if prov==44 | prov==53  
 	// drop if prov==35 | prov==45  
 	// drop if prov==21 | prov==22 | prov==23 | prov==14 | prov==15 | prov==62 | prov==64
	// drop if  prov==44 | prov==50 | prov==54 | prov==63 | prov==65
	reghdfe yedu_4_2  lag_degree1 [w=count] , absorb(uid2000 year) cluster(uid2000) 		
	reghdfe yedu_4_2_f lag_degree1 [w=count], absorb(uid2000  year)  cluster(uid2000)  	   
	reghdfe yedu_4_2_m lag_degree1 [w=count], absorb(uid2000  year) cluster(uid2000) 		
	reghdfe yedu_4_2_diff lag_degree1 [w=count] , absorb(uid2000 year) cluster(uid2000) 
	restore
	
	// Table D5
	use cohort_loss, clear
	merge 1:1 uid2000 year using Weather_uid2000 
	drop if _merge!=3
	drop _merge
	replace degree1 = degree1 / 100	
	drop if loss_4_2==. | loss_4_2_m==. | loss_4_2_f==.
	gen diff_4_2 = loss_4_2_f - loss_4_2_m 
	xtset uid2000 year
	preserve
    drop if year>=1959 & year<=1961
	drop if year<=1956
	summ loss_4_2*
	reghdfe loss_4_2   L.degree1     , absorb(uid2000 year ) cluster(uid2000) 
	reghdfe loss_4_2_m L.degree1   , absorb(uid2000 year) cluster(uid2000) 
	reghdfe loss_4_2_f L.degree1     , absorb(uid2000 year) cluster(uid2000) 
	restore
	
